/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * Author: zhnb
 * Date: 2011-4-11 下午03:49:14
 */

package com.ccx.memc;

import java.io.Serializable;
import java.util.Arrays;

/**
 * 内存缓存客户端配置信息
 * 
 */
public class MemcConfigInfo implements Serializable {

    private static final long serialVersionUID = -78895153413108L;

    // 服务器列表
    private String[] servers;
    // 对应权重
    private Integer[] weights;

    // 初始连接数
    private int initConn;
    // 最小连接数
    private int minConn;
    // 最大连接数
    private int maxConn;
    // 最大处理时间(ms)
    private long maxIdle;

    // 主线程休眠时间
    private int maintSleep;

    // TCP配置
    private boolean nagle;
    private int socketTO;
    private int socketConnectTO;

    // 是否压缩
    private boolean compressEnable;
    // 压缩边界(bit)
    private int compressThreshold;

    public MemcConfigInfo() {
        super();
    }

    public String[] getServers() {
        return servers;
    }

    public void setServers(String[] servers) {
        this.servers = servers;
    }

    public Integer[] getWeights() {
        return weights;
    }

    public void setWeights(Integer[] weights) {
        this.weights = weights;
    }

    public int getInitConn() {
        return initConn;
    }

    public void setInitConn(int initConn) {
        this.initConn = initConn;
    }

    public int getMinConn() {
        return minConn;
    }

    public void setMinConn(int minConn) {
        this.minConn = minConn;
    }

    public int getMaxConn() {
        return maxConn;
    }

    public void setMaxConn(int maxConn) {
        this.maxConn = maxConn;
    }

    public long getMaxIdle() {
        return maxIdle;
    }

    public void setMaxIdle(long maxIdle) {
        this.maxIdle = maxIdle;
    }

    public int getMaintSleep() {
        return maintSleep;
    }

    public void setMaintSleep(int maintSleep) {
        this.maintSleep = maintSleep;
    }

    public boolean isNagle() {
        return nagle;
    }

    public void setNagle(boolean nagle) {
        this.nagle = nagle;
    }

    public int getSocketTO() {
        return socketTO;
    }

    public void setSocketTO(int socketTO) {
        this.socketTO = socketTO;
    }

    public int getSocketConnectTO() {
        return socketConnectTO;
    }

    public void setSocketConnectTO(int socketConnectTO) {
        this.socketConnectTO = socketConnectTO;
    }

    public boolean isCompressEnable() {
        return compressEnable;
    }

    public void setCompressEnable(boolean compressEnable) {
        this.compressEnable = compressEnable;
    }

    public int getCompressThreshold() {
        return compressThreshold;
    }

    public void setCompressThreshold(int compressThreshold) {
        this.compressThreshold = compressThreshold;
    }

    @Override
    public String toString() {
        return "MemcConfigInfo [compressEnable=" + compressEnable
                + ", compressThreshold=" + compressThreshold + ", initConn="
                + initConn + ", maintSleep=" + maintSleep + ", maxConn="
                + maxConn + ", maxIdle=" + maxIdle + ", minConn=" + minConn
                + ", nagle=" + nagle + ", servers=" + Arrays.toString(servers)
                + ", socketConnectTO=" + socketConnectTO + ", socketTO="
                + socketTO + ", weights=" + Arrays.toString(weights) + "]";
    }

}
